<?php
require_once('system/MyFunc.php');  

    require_once('system/dbConnect.php');   //连接数据库   
  connect();
if(!empty($_FILES["lyj_pic"]["name"])){
   $lc_pic = uploadfile('lyj_pic','uplaod/',array('jpg','gif','png'));
  }
  else{
    $lc_pic='';
  }

  $data = array( 
   //'lc_id'=> $_POST['lc_id'],
   'lyj_title' => $_POST['lyj_title'],
    
   'lyj_place' => $_POST['lyj_place'],
    'lyj_intro' => $_POST['lyj_intro'],
    'lyj_adddate' => $_POST['lyj_adddate'],
    'lyj_hint' => $_POST['lyj_hint'],

    'lyj_pic' => $lc_pic,);
  //执行SQL语句
   $result = add('flower',$data);
  if(!$result)
  {
    echo "添加失败！<br/>";
    echo "<a href='addflower.php'>返回</a>";    
  }
  else
  {   
   redirect('flowerlist.php','添加成功！'); 
  }    
?>
